<template>
  <div class="home_box">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column type="index" label="序号" width="100" align="center"/>
      <el-table-column prop="name" label="名称" align="center" />
      <el-table-column prop="content" label="内容" align="center" />
      <el-table-column prop="deadline" label="日期" align="center" />
    </el-table>
    <div class="example-pagination-block">
      <el-pagination layout="prev, pager, next" :total="total" @current-change="handleCurrentChange"/>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted,reactive } from 'vue'
import { get, post } from '../request/api';
let params:any = {
  status:-1,
  page:1,
  limit:10
}
let total = ref(10)
const tableData = ref( )
const getList = () => {
  post('/list', params).then(res => {
    tableData.value = res.list.rows
    total.value = res.list.count
  })
}
const handleCurrentChange = (val: number) => {
  params.page = val
  getList()
}
onMounted(getList)
</script>

<style lang="less" scoped>
.home_box{
  width: 100%;
  height: 100%;
}
</style>